package com.ssy.lingxi.search.api.hystrix;

import com.ssy.lingxi.common.constant.tree.Node;
import com.ssy.lingxi.common.exception.BusinessException;
import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.ResponseCode;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.search.api.feign.ITemplateFeign;
import com.ssy.lingxi.search.api.model.request.StoreIdListRequest;
import com.ssy.lingxi.search.api.model.request.TemplateCommoditySearchRequest;
import com.ssy.lingxi.search.api.model.response.BrandResponse;
import com.ssy.lingxi.search.api.model.response.CategoryResponse;
import com.ssy.lingxi.search.api.model.response.CommoditySearchResponse;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * 模板服务-熔断服务实现类
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/6/24
 */
@Component
@Qualifier("templateHystrix")
public class TemplateHystrix implements ITemplateFeign {

    @Override
    public Wrapper<List<Node>> getCategoryTree(Long shopId, Long memberId, Long memberRoleId) {
        throw new BusinessException(ResponseCode.SERVICE_SEARCH_ERROR);
    }

    @Override
    public Wrapper<List<CategoryResponse>> getFirstCategoryListByMemberId(Long shopId, Long memberId, Long memberRoleId) {
        throw new BusinessException(ResponseCode.SERVICE_SEARCH_ERROR);
    }

    @Override
    public Wrapper<List<CategoryResponse>> getSecondCategoryListByMemberId(Long shopId, Long memberId, Long memberRoleId, Long categoryId) {
        throw new BusinessException(ResponseCode.SERVICE_SEARCH_ERROR);
    }

    @Override
    public Wrapper<List<Long>> getMemberIdByCategory(Long shopId, Long categoryId) {
        throw new BusinessException(ResponseCode.SERVICE_SEARCH_ERROR);
    }

    @Override
    public Wrapper<PageData<CommoditySearchResponse>> searchCommodityList(TemplateCommoditySearchRequest templateCommoditySearchRequest) {
        throw new BusinessException(ResponseCode.SERVICE_SEARCH_ERROR);
    }

    @Override
    public Wrapper<PageData<BrandResponse>> getBrandList(Integer current, Integer pageSize, Long shopId, Long customerCategoryId, Long categoryId, Long memberId, Long memberRoleId, String memberName, String name, List<Long> idInList, List<Long> idNotInList) {
        throw new BusinessException(ResponseCode.SERVICE_SEARCH_ERROR);
    }

    @Override
    public Wrapper<Map<Long, List<CommoditySearchResponse>>> getCommodityListByPublishTime(StoreIdListRequest storeIdListRequest) {
        throw new BusinessException(ResponseCode.SERVICE_SEARCH_ERROR);
    }

    @Override
    public Wrapper<Map<Long, List<CommoditySearchResponse>>> getCommodityListBySoldCount(StoreIdListRequest storeIdListRequest) {
        throw new BusinessException(ResponseCode.SERVICE_SEARCH_ERROR);
    }
}
